Go to advanced search

by Alex_Landherr
Wed Jan 13, 2021 11:27 pm
Forum: Other projects
Topic: Downloading Images from Weather Satellites with cURL & Wget [Updated 2021-01-14]
Replies: 6
Views: 897

Re: Downloading Images from Weather Satellites with cURL & Wget [Updated 2021-01-14]

Most recent version [Updated 2021-01-14] Now with Generators! V30: from datetime import datetime, timedelta, timezone import time from PIL import Image, ImageDraw import requests import wget import glob import os from UTC_time_stamp import UTC_time_stamp from file_prefixes import file_prefixes from...
by Alex_Landherr
Wed Jan 13, 2021 8:22 pm
Forum: Python
Topic: How To Rewrite For Loop as a Generator?
Replies: 6
Views: 230

Re: How To Rewrite For Loop as a Generator?

Here's the working code in its entirety, where generate_image_date was made to make my incomplete file handling routine work without indexes: from datetime import datetime, timedelta, timezone import time from PIL import Image, ImageDraw import requests import wget import glob import os from UTC_tim...
by Alex_Landherr
Wed Jan 13, 2021 6:28 pm
Forum: Python
Topic: How To Rewrite For Loop as a Generator?
Replies: 6
Views: 230

Re: How To Rewrite For Loop as a Generator?

Here is a quick example of how to turn this in to a generator. I've also used an f-string to format the image_date as your method of using .format and + to concatenate strings wasn't the most efficient way to do it. The values such as start, image interval and number of images are hardcoded. from d...
by Alex_Landherr
Tue Jan 12, 2021 7:44 pm
Forum: Other projects
Topic: Downloading Images from Weather Satellites with cURL & Wget [Updated 2021-01-14]
Replies: 6
Views: 897

Re: Downloading Images from Weather Satellites with cURL & Wget [Updated 2021-01-12]

Most recent version [Added 2021-01-12] V29: from datetime import datetime, timedelta, timezone import time from PIL import Image, ImageDraw import requests import wget import glob import os from UTC_time_stamp import UTC_time_stamp from file_prefixes import file_prefixes from supersleep import supe...
by Alex_Landherr
Tue Jan 12, 2021 7:40 pm
Forum: Python
Topic: How To Rewrite For Loop as a Generator?
Replies: 6
Views: 230

How To Rewrite For Loop as a Generator?

I need help with rewriting a portion of my code so that it does not use a for loop. The code in question creates two dictionaries which are used later in the program. With the code below is there another way to this with less code? The full program takes in two timestamps and downloads images from a...
by Alex_Landherr
Fri Jan 01, 2021 5:26 pm
Forum: Beginners
Topic: Entering "clear" Command Makes The Prompt Look Weird [SOLVED]
Replies: 0
Views: 101

Entering "clear" Command Makes The Prompt Look Weird [SOLVED]

I've recently done a setup of a headless Pi Zero W (Rev 1.1). I am using Raspberry Pi OS Lite and connecting to it via SSH. When I enter the clear command the terminal prompt looks like this: pi@raspberrypi:~ $ pi@raspberrypi:~ $ This doesn't happen on my Pi4B's that run the OS with the desktop inst...
by Alex_Landherr
Thu Dec 31, 2020 2:59 pm
Forum: HATs and other add-ons
Topic: Will This 7 Segment Display work with the Pi?
Replies: 11
Views: 623

Re: Will This 7 Segment Display work with the Pi?

Could I use this simultaneously with the Adafruit one on a Pi Zero W?:
https://www.electrokit.com/en/product/ ... r-seriell/

The intention is so that I have one for the YYYY-MM-DD part of the time and the Adafruit one for the HH:MM part.
by Alex_Landherr
Thu Dec 31, 2020 11:18 am
Forum: Python
Topic: What’s the Recommended Way to Measure Elapsed Time in Python? [SOLVED]
Replies: 2
Views: 120

What’s the Recommended Way to Measure Elapsed Time in Python? [SOLVED]

For a download process in a program I need to measure the time taken to download the data and from that calculate the average download speed. I am currently using something that roughly looks like this: from datetime import datetime, timedelta, timezone import wget import os start = datetime.now(tim...
by Alex_Landherr
Sat Dec 26, 2020 7:44 pm
Forum: Other projects
Topic: Downloading Images from Weather Satellites with cURL & Wget [Updated 2021-01-14]
Replies: 6
Views: 897

Re: Downloading Images from Weather Satellites with cURL & Wget [Updated 2020-12-26]

Most recent version [Added 2020-12-26] With the version below the use of an external program has been eliminated. Via the wget python module the images are downloaded and an average download speed is calculated by my own code. V28: from datetime import datetime, timedelta, timezone from PIL import ...
by Alex_Landherr
Mon Dec 14, 2020 3:30 pm
Forum: HATs and other add-ons
Topic: Will This 7 Segment Display work with the Pi?
Replies: 11
Views: 623

Re: Will This 7 Segment Display work with the Pi?

I’ve been looking into this 8 digit 7 segment display: https://www.electrokit.com/en/product/led-modul-7-segment-8-siffror-seriell/ That will work. There's even a python library to drive it. https://github.com/rm-hull/luma.led_matrix Thanks for the verification! You don’t happen to know one which u...
by Alex_Landherr
Mon Dec 14, 2020 1:22 pm
Forum: HATs and other add-ons
Topic: Will This 7 Segment Display work with the Pi?
Replies: 11
Views: 623

Re: Will This 7 Segment Display work with the Pi?

Would this one: https://robotdyn.com/6-digit-led-display-tube-7-segments-46x14mm-tm1637.html work with this library or is the library restricted to 4 digits?: https://github.com/depklyon/raspberrypi-tm1637 I ordered this 4 digit Adafruit module: https://thepihut.com/products/adafruit-0-56-4-digit-7-...
by Alex_Landherr
Sat Dec 12, 2020 2:26 pm
Forum: HATs and other add-ons
Topic: Will This 7 Segment Display work with the Pi?
Replies: 11
Views: 623

Re: Will This 7 Segment Display work with the Pi?

Only a temporary clock though, not always connected. Maybe I'll get a Pi Zero for this at a later time. I did find this 6 digit 7 segment display: https://robotdyn.com/6-digit-led-display-tube-7-segments-46x14mm-tm1637.html Would this Python library work for the display module I linked to?: https://...
by Alex_Landherr
Sat Dec 12, 2020 1:14 pm
Forum: HATs and other add-ons
Topic: Will This 7 Segment Display work with the Pi?
Replies: 11
Views: 623

Re: Will This 7 Segment Display work with the Pi?

I have access to soldering kit and equipment but not enough to make some setup on a prototyping board or breadboard. The Adafruit one is great because of the backpack and related code and tutorials but as said above a 6 digit would be ideal for my clock. EDIT: I found this tutorial on setup and usag...
by Alex_Landherr
Sat Dec 12, 2020 1:11 pm
Forum: HATs and other add-ons
Topic: Will This 7 Segment Display work with the Pi?
Replies: 11
Views: 623

Will This 7 Segment Display work with the Pi?

I’ve been looking into this 8 digit 7 segment display: https://www.electrokit.com/en/product/led-modul-7-segment-8-siffror-seriell/ Will it work with a Raspberry Pi 4B or should I just use this one?: https://thepihut.com/products/adafruit-0-56-4-digit-7-segment-display-w-i2c-backpack-green The probl...
by Alex_Landherr
Tue Dec 01, 2020 4:05 pm
Forum: HATs and other add-ons
Topic: Configuring a DS3231 RTC
Replies: 10
Views: 442

Re: Configuring a DS3231 RTC

One more question: Does the Pi sync the RTC sometimes via NTP when an internet connection is available or do I have to do that manually? Eventually the RTC will drift too much and will need an external source to sync to. Or is it like your run of the mill PC wherein the RTC is regularly updated with...
by Alex_Landherr
Tue Dec 01, 2020 3:21 pm
Forum: HATs and other add-ons
Topic: Configuring a DS3231 RTC
Replies: 10
Views: 442

Re: Configuring a DS3231 RTC

Got it, the most recent I could find was 2-3 years old and for the Pi3B+ or so.
by Alex_Landherr
Tue Dec 01, 2020 3:08 pm
Forum: HATs and other add-ons
Topic: Configuring a DS3231 RTC
Replies: 10
Views: 442

Re: Configuring a DS3231 RTC

So I’m good then I guess? Maybe some of these tutorials needs an update for 2020 and later?
by Alex_Landherr
Tue Dec 01, 2020 2:50 pm
Forum: HATs and other add-ons
Topic: Configuring a DS3231 RTC
Replies: 10
Views: 442

Re: Configuring a DS3231 RTC

The following command in the tutorial linked to in the first post: sudo modprobe ds3231 gives me a “FATAL ERROR” style error. The only way I found that worked was to write: sudo modprobe ds1307 as in the tutorial. The rest of the tutorial I followed along with removing and disabling the “fake-hwcloc...
by Alex_Landherr
Fri Nov 20, 2020 10:00 pm
Forum: HATs and other add-ons
Topic: Configuring a DS3231 RTC
Replies: 10
Views: 442

Configuring a DS3231 RTC

When configuring this RTC: https://thepihut.com/products/mini-rtc-module-for-raspberry-pi with these instructions: https://thepihut.com/blogs/raspberry-pi-tutorials/17209332-adding-a-real-time-clock-to-your-raspberry-pi Should I write "DS1307" or "DS3231" when configuring the RTC...
by Alex_Landherr
Wed Nov 11, 2020 9:48 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Will This RTC Module Fit on The Pi4B?
Replies: 2
Views: 232

Re: Will This RTC Module Fit on The Pi4B?

So now way to use it even with this GPIO riser/header?:
https://thepihut.com/products/gpio-head ... -pi-4-zero
by Alex_Landherr
Tue Nov 10, 2020 10:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Will This RTC Module Fit on The Pi4B?
Replies: 2
Views: 232

Will This RTC Module Fit on The Pi4B?

I'm considering buying this RTC: https://thepihut.com/products/adafruit-pirtc-precise-ds3231-real-time-clock-for-raspberry-pi-ada4282 and my question is whether it will fit with this case/cooler? Will the case/cooler be in the way somehow?: https://thepihut.com/collections/raspberry-pi-cases/product...
by Alex_Landherr
Sun Nov 08, 2020 9:32 pm
Forum: Python
Topic: Replacing Blank Fields in a CSV Column with a New Value
Replies: 10
Views: 382

Re: Replacing Blank Fields in a CSV Column with a New Value

Now I have version that works, I added some lines to take away the old .csv file after the CET/CEST time stamp was added. I do have another question; is there a good way to do this with context managers for what you helped me with? Here's the code that works: from gpiozero import CPUTemperature from...
by Alex_Landherr
Sun Nov 08, 2020 11:04 am
Forum: Python
Topic: Replacing Blank Fields in a CSV Column with a New Value
Replies: 10
Views: 382

Re: Replacing Blank Fields in a CSV Column with a New Value

So what you need to do is open your existing file for reading read in each line in turn , then split the line at the commas, you can now select the data field that has your time in it and us it to do you conversion , then you can let the blank field equal the new value . You then need to write the ...
by Alex_Landherr
Sat Nov 07, 2020 9:12 pm
Forum: Python
Topic: Replacing Blank Fields in a CSV Column with a New Value
Replies: 10
Views: 382

Replacing Blank Fields in a CSV Column with a New Value

My problem is that I need to replace a column with blank fields in a .csv file with new values. The blank fields contain two blankspace characters. My program logs the temperature in degrees Celsius of the RPi4B SoC as well as the time each measurement was taken and puts them in a .csv file. Because...

Go to advanced search