Go to advanced search

by DougieLawson
Sat Jun 15, 2019 10:45 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 503
Views: 12885

Re: A Final Fibonacci Challenge

I found this https://www.nayuki.io/page/fast-fibonacci-algorithms Got it working with the supplied python3 program #!/usr/bin/python3 # (Public) Returns F(n). def fibonacci(n): if n < 0: raise ValueError("Negative arguments not implemented") return _fib(n)[0] # (Private) Returns the tuple (F(n), F(n...
by DougieLawson
Sat Jun 15, 2019 5:59 pm
Forum: Troubleshooting
Topic: Cant ping 8.8.8.8 get "Destination Host Unreachable"
Replies: 8
Views: 118

Re: Cant ping 8.8.8.8 get "Destination Host Unreachable"

That makes no sense whatsoever. Is your network exclusively IPv6?
by DougieLawson
Sat Jun 15, 2019 5:05 pm
Forum: Troubleshooting
Topic: Cant ping 8.8.8.8 get "Destination Host Unreachable"
Replies: 8
Views: 118

Re: Cant ping 8.8.8.8 get "Destination Host Unreachable"

I'll assume it's a 2018 3B+ not a 2014 B+.

Can you ping bbc.co.uk and ping 151.101.192.81?
Can you ping 8.8.4.4?
Does https://google.com/ work in a web browser?

Have you activated any firewall?
by DougieLawson
Sat Jun 15, 2019 4:53 pm
Forum: C/C++
Topic: using dynamically loaded libraries causes segmentation fault
Replies: 2
Views: 52

Re: using dynamically loaded libraries causes segmentation fault

You're missing the dlsym calls for the two functions that get the segfaults.

If you use RTLD_LAZY you have to register (with dlsym()) every function you want to use from the dynamically loaded library.
by DougieLawson
Fri Jun 14, 2019 12:01 am
Forum: Beginners
Topic: How do you name your Pies?
Replies: 14
Views: 281

Re: How do you name your Pies?

They're named after various NASA missions and launch vehicles.

apollo
challenger
discovery
eagle
endeavour
falcon
gemini
hitchhiker
intrepid
mercury
odyssey
pioneer
ranger
saturn
tranquility
ulysses
viking

Odd one out is my weather station which is called beaufort.
by DougieLawson
Tue Jun 11, 2019 7:50 pm
Forum: Beginners
Topic: Remove Network Features @ Software Level (Raspian)
Replies: 5
Views: 149

Re: Remove Network Features @ Software Level (Raspian)

What do you think you'll achieve by doing that?

You can delete any /lib/modules/**/net drivers but it's going to be disappointing when you find you want to connect to a network later.

I really can't see the point in crippling the OS in that way for a perceived threat that doesn't exist.
by DougieLawson
Tue Jun 11, 2019 7:38 pm
Forum: General discussion
Topic: Getting IP from headless RPi
Replies: 10
Views: 365

Re: Getting IP from headless RPi

If I were displaying 15. That would be one short four long five short. (. ---- .....)

Morse code removes any ambiguity and needs five pulses for each digit.
by DougieLawson
Tue Jun 11, 2019 1:51 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: [SOLVED] PiServer Client Wrong Time
Replies: 17
Views: 291

Re: PiServer Client Wrong Time

How far off is the time? One hour? Two hours?
by DougieLawson
Tue Jun 11, 2019 7:08 am
Forum: Beginners
Topic: Angle of the Sun from a Python Library
Replies: 3
Views: 106

Re: Angle of the Sun from a Python Library

Start here: https://rhodesmill.org/pyephem/ follow the links to the replacement Ephemeris libraries.
by DougieLawson
Tue Jun 11, 2019 6:57 am
Forum: Beginners
Topic: Retrieving MySQL data from Windows Excel
Replies: 20
Views: 931

Re: Retrieving MySQL data from Windows Excel

Have you created a user that's allowed from any LAN address. The default is localhost only.

https://www.cyberciti.biz/tips/how-do-i ... erver.html
by DougieLawson
Tue Jun 11, 2019 6:51 am
Forum: HATs and other add-ons
Topic: TV Hat
Replies: 2
Views: 70

Re: TV Hat

I got my TV HAT working in Perth, WA. I seem to remember just choosing the general Australian option and not anything specific (mainly because I didn't know which transmitter is near my daughter's house).

That scanned all possible DVB-T channels on the VHF & UHF frequencies.
by DougieLawson
Fri Jun 07, 2019 5:05 pm
Forum: Python
Topic: Reading LDR with MCP3008
Replies: 6
Views: 147

Re: Reading LDR with MCP3008

Rather than showing a Fritzing diagram of what you think the wiring should look like, show a photo of your actual wiring.
by DougieLawson
Fri Jun 07, 2019 4:15 pm
Forum: Troubleshooting
Topic: USB ports not working at all after updating.
Replies: 26
Views: 489

Re: USB ports not working at all after updating.

You could also improve the "NOTICE.md" file at https://raw.githubusercontent.com/hexxeh/rpi-firmware/f5e1ff99d6600fcc6d869a8c4fb63a5bb3a3e824/NOTICE.md HASH: 152b6b858d2f6b94fa398fa4545d5e130ab24434 ############################################################# WARNING: This update bumps to rpi-4.19....
by DougieLawson
Thu Jun 06, 2019 7:49 pm
Forum: Networking and servers
Topic: Git server
Replies: 3
Views: 130

Re: Git server

The locally hosted git server is easy https://gitolite.com/gitolite/index.html

The automatic sync is not so easy.
by DougieLawson
Mon Jun 03, 2019 6:17 pm
Forum: Beginners
Topic: Transferring OS with settings from RPI 3B to 3B+
Replies: 4
Views: 116

Re: Transferring OS with settings from RPI 3B to 3B+

It depends.

1. Is it NOOBS?
2. Was it built before the 3B+ was launched?
3. Is it Wheezy, Jessie or Stretch? Which one?
by DougieLawson
Mon Jun 03, 2019 5:04 pm
Forum: Other projects
Topic: python and crontab
Replies: 6
Views: 144

Re: python and crontab

If it's your own crontab you don't need the userid. */1 8-20 * * * /usr/bin/python /home/pi/Desktop/heating.py 0 6-8 * * * /usr/bin/python /home/pi/Desktop/cleaning_start.py 01 8 * * * /usr/bin/python /home/pi/Desktop/cleaning_stop.py That will run heating.py every minute from 08:00 until 20:00. cle...
by DougieLawson
Mon Jun 03, 2019 4:56 pm
Forum: Advanced users
Topic: After rpi-update USB boot doesn't work
Replies: 19
Views: 641

Re: After rpi-update USB boot doesn't work

...Create a new script that displays a disclaimer message when run "This could break your system and if you don't know what you are doing and how to fix it yourself - don't run it!" and asks for confirmation "Yes, I really know what I'm doing and do have a tested and working backup of my system: Y/...
by DougieLawson
Mon Jun 03, 2019 12:06 pm
Forum: Official Foundation Display
Topic: Turning off the display!
Replies: 1
Views: 115

Re: Turning off the display!

There isn't. All you can do is set the backlight off.

https://github.com/DougieLawson/backlight_dimmer is a bit off code to dim the backlight to black when there's no touch input on it.
by DougieLawson
Sun Jun 02, 2019 2:27 pm
Forum: Python
Topic: Python3 network module seems not to have WLAN attribute
Replies: 12
Views: 298

Re: Python3 network module seems not to have WLAN attribute

Post a link to the instructions/tutorial you are following. Those docs clearly don't match what you've installed and how you're trying to use it.

We can't help without that after the Great Crystal Ball Disaster of 1989.
by DougieLawson
Sun Jun 02, 2019 8:26 am
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1070

Re: Emergency Action Required by RPi Foundation

ankith26 wrote:
Sun Jun 02, 2019 6:04 am
but the bigger question is, who uses python2 nowadays....
I am sure that python2 will become a forgotten memory within 5 years
The problem is that while python remains an alias for python2 (and therefore the default interpreter) then all naïve users will continue to fall into the python2 trap.
by DougieLawson
Sun Jun 02, 2019 8:22 am
Forum: Troubleshooting
Topic: Raspberry Pi not lighting up at all, official 7” touchscreen
Replies: 14
Views: 273

Re: Raspberry Pi not lighting up at all, official 7” touchscreen

If the red LED doesn't come on then your RPi is dead. The usual way to kill them is over voltage on a GPIO or shorting pin#1 (3.3V) to pin#2 (5V).

The repair costs £35.
by DougieLawson
Sat Jun 01, 2019 11:12 pm
Forum: Troubleshooting
Topic: BrightPi Schedule On/Off in Python?
Replies: 10
Views: 214

Re: BrightPi Schedule On/Off in Python?

Try using sudo pip3 ... to install it and python3 to run it.
by DougieLawson
Sat Jun 01, 2019 11:10 pm
Forum: Python
Topic: Emergency Action Required by RPi Foundation
Replies: 31
Views: 1070

Re: Emergency Action Required by RPi Foundation

I think your and our definition of emergency may differ. It would be good if Buster made python3/pip3 the system-wide default version (so you have to make an effort to deliberately run python2/pip2) as that would reduce the number of "my python program doesn't work" threads created on here. I'd gue...

Go to advanced search