Go to advanced search

by seanspotatobusiness
Tue Apr 23, 2019 9:46 pm
Forum: Python
Topic: Sending individual lines to an LCD display, bumping up the previous lines
Replies: 11
Views: 537

Re: Sending individual lines to an LCD display, bumping up the previous lines

Thanks very much. I think this is all I need now! Edit: it's working. In case anyone wants the final code, the sender is as follows: import os import time fifoName = "/tmp/test.fifo" try : os.mkfifo(fifoName) except OSError : pass for n in range(1,6): with open(fifoName,"w") as f: f.write("TO Sean__...
by seanspotatobusiness
Mon Apr 22, 2019 8:11 pm
Forum: Python
Topic: Sending individual lines to an LCD display, bumping up the previous lines
Replies: 11
Views: 537

Re: Sending individual lines to an LCD display, bumping up the previous lines

Thanks again; I think it's working after separating it into two programs. Is there some way to limit the FIFO to two lines so that the oldest gets deleted when another is added? I'm trying to get the reader file to send output to the LCD screen but it's not accepting my first attempt. I know my firs...
by seanspotatobusiness
Mon Apr 22, 2019 2:38 pm
Forum: Python
Topic: Sending individual lines to an LCD display, bumping up the previous lines
Replies: 11
Views: 537

Re: Sending individual lines to an LCD display, bumping up the previous lines

Thanks very much. You said it's important to close the FIFO but it looks like your code doesn't do that? Do I need "close.fifoName()" at the end of the write and read sections? import os import sys fifoName = "/tmp/16x2_LCD.fifo" try : os.mkfifo(fifoName) except OSError : pass for n in range(1,6): w...
by seanspotatobusiness
Mon Apr 22, 2019 3:20 am
Forum: Python
Topic: Sending individual lines to an LCD display, bumping up the previous lines
Replies: 11
Views: 537

Re: Sending individual lines to an LCD display, bumping up the previous lines

Thanks very much. I'm attempting to use this example: http://timmurphy.org/2013/11/11/using-fifos-in-python/ My test python file has path = "/tmp/16x2_LCD.fifo" os.mkfifo(path) The problem I encounter is that when the python file is run again I get the error: $ python /home/pi/Mining/LCDUpdater.py T...
by seanspotatobusiness
Mon Apr 22, 2019 12:11 am
Forum: Python
Topic: Sending individual lines to an LCD display, bumping up the previous lines
Replies: 11
Views: 537

Re: Sending individual lines to an LCD display, bumping up the previous lines

Since my scripts are running independently of each other, should I send the output of each one to a log file and then use another script to print the last two lines of the log file to the LCD? If script one sends a line to the LCD, script two does not know about it in order to rewrite it. I think I ...
by seanspotatobusiness
Sun Apr 21, 2019 6:31 pm
Forum: Python
Topic: Sending individual lines to an LCD display, bumping up the previous lines
Replies: 11
Views: 537

Sending individual lines to an LCD display, bumping up the previous lines

I have a few different python scripts which monitor some websites' APIs and send notifications to my phone when conditions are met. The different scripts run inside separate panes in a tmux window and print to the screen every five minutes the time/date and status. I recently added a 16x2 LCD displa...
by seanspotatobusiness
Sun Apr 21, 2019 6:00 pm
Forum: Beginners
Topic: Selecting GPIO pins for LCD character screen
Replies: 9
Views: 420

Re: Selecting GPIO pins for LCD character screen

It turns out that the contrast was set so that all the characters on the screen presented as solid blocks. Lowering the contrast made the letters appear.

I'll remove the u from the code since it's superfluous.
by seanspotatobusiness
Sun Apr 21, 2019 5:59 am
Forum: Beginners
Topic: Selecting text automatically copies it - how to stop
Replies: 7
Views: 346

Selecting text automatically copies it - how to stop

I often like to select text, copy it and then select other text and paste over it. The behaviour of my Raspberry Pi prevents this because when I select the text which I want to delete or paste over, it gets copied to the clipboard, replacing the text I already copied. Is there a way to make Raspbian...
by seanspotatobusiness
Sun Apr 21, 2019 4:02 am
Forum: Beginners
Topic: Selecting GPIO pins for LCD character screen
Replies: 9
Views: 420

Re: Selecting GPIO pins for LCD character screen

Thanks very much. Proceeding with next phase! My attempt to put text on the screen isn't working. I have the following python script: import RPi.GPIO as GPIO from RPLCD.gpio import CharLCD # Initialize display. All values have default values and are therefore # optional. lcd = CharLCD(pin_rs=36, pin...
by seanspotatobusiness
Sun Apr 21, 2019 3:42 am
Forum: Beginners
Topic: Selecting GPIO pins for LCD character screen
Replies: 9
Views: 420

Selecting GPIO pins for LCD character screen

I need to select seven GPIO pins for an LCD I'd like to use; six for 4-bit communication and one for (100-300 Hz) PWM LCD brightness control. I prefer blocks of pins rather than scattered pins. For this low-frequency PWM, do it matter whether I use software vs hardware PWM? There are many tutorials ...
by seanspotatobusiness
Sun Apr 21, 2019 2:13 am
Forum: Beginners
Topic: What transistor to use for PWM of LCD backlight
Replies: 1
Views: 136

What transistor to use for PWM of LCD backlight

I would like to use a 16x2 LCD (10-year old discontinued CFAH1602B-YMI-JP) screen with my Pi 3B+ and I would like the Pi to automatically change the brightness of the LCD in response to ambient light. My LCD datasheet suggests I can do this with PWM of the power to the LCD backlight and I wanted to ...
by seanspotatobusiness
Thu Mar 28, 2019 6:31 pm
Forum: Beginners
Topic: Is "backfeed" a problem if USB hub and Pi both use same 5 V source?
Replies: 5
Views: 329

Is "backfeed" a problem if USB hub and Pi both use same 5 V source?

I will be powered my Pi 3 B+ and a USB hub from an old PC PSU which can provide plenty of power at 5 V to both the Pi and the hub and peripherals. Does that mean I don't need to concern myself with whether the USB hub "backfeeds" power to the Pi since they'll both be getting the same voltage from th...
by seanspotatobusiness
Tue Dec 18, 2018 9:02 am
Forum: Beginners
Topic: SSH security
Replies: 9
Views: 565

Re: SSH security

My router has settings so that I can whitelist specific IP addresses to be allowed to connect through a particular port to particlar machine on the network.
by seanspotatobusiness
Sat Dec 08, 2018 3:50 am
Forum: Beginners
Topic: How to access a tmux pane from another window
Replies: 5
Views: 423

Re: How to access a tmux pane from another window

The solution to copy and paste from a single window is to press Ctrl + B, Z to zoom into a pane. The same command zooms back out afterwards.
by seanspotatobusiness
Fri Nov 09, 2018 3:14 am
Forum: Beginners
Topic: How to access a tmux pane from another window
Replies: 5
Views: 423

Re: How to access a tmux pane from another window

If I try to copy and paste from the multi-pane window, this is what the selection looks like - you can't just select the stuff from one pane because everything across multiple panes gets selected: https://imgur.com/Ss7hEER.png It looks like the attach command only accepts an argument for what sessio...
by seanspotatobusiness
Thu Nov 08, 2018 10:41 pm
Forum: Beginners
Topic: How to access a tmux pane from another window
Replies: 5
Views: 423

How to access a tmux pane from another window

I have a console window which is split into multiple panes with tmux. Something went wrong with a script in one of the panes and I'd like to copy and paste the error message. To do this, I'd like to get the output all in one window. Are there commands I can type to access this one pane in a new wind...
by seanspotatobusiness
Thu Sep 20, 2018 4:57 pm
Forum: Beginners
Topic: Guide on powering Raspberry Pi 3 B+ with ATX PSU?
Replies: 7
Views: 1894

Re: Guide on powering Raspberry Pi 3 B+ with ATX PSU?

The basic idea is to take a 5V and ground cable from your ATX psu from some thing like a Molex 4 pin power supply connector and wire them to a micro usb plug so that you can connect it to your pi. Red being 5v. Black being ground. This is exactly how I power my Raspberry Pis. I bought the microUSB ...
by seanspotatobusiness
Wed Sep 12, 2018 12:40 am
Forum: Beginners
Topic: Script monitoring API - recovery after failure to respond to get request
Replies: 6
Views: 560

Re: Script monitoring API - recovery after failure to respond to get request

When I run the modified code I get the following output: request status OK= 200 {"success":false,"error":"Must be authorized"} 0912 00:43 No new trades detected Although it rejects the format of the credentials, it seems to be working. I will have to wait a few days to see if it handles an error fro...
by seanspotatobusiness
Mon Sep 10, 2018 10:01 pm
Forum: Beginners
Topic: Script monitoring API - recovery after failure to respond to get request
Replies: 6
Views: 560

Re: Script monitoring API - recovery after failure to respond to get request

Probably you will want to restructure the code slightly, not just replace the with. And you probably need to add some checking of the API return status code. Here http returns success (200) but the API returns "false" The API documentation does not look very good IMHO. Something like import request...
by seanspotatobusiness
Fri Sep 07, 2018 11:44 pm
Forum: Beginners
Topic: How to automatically mute/unmute Pi between certain hours?
Replies: 17
Views: 1723

Re: How to automatically mute/unmute Pi between certain hours?

It seems to be working now. Thanks for your help!
by seanspotatobusiness
Fri Sep 07, 2018 11:21 pm
Forum: Beginners
Topic: Script monitoring API - recovery after failure to respond to get request
Replies: 6
Views: 560

Re: Script monitoring API - recovery after failure to respond to get request

Thanks but I replaced "with" with "try" and the script doesn't run: $ python /home/pi/Mining/TradeOgreNotificationScript_Sean.py File "/home/pi/Mining/TradeOgreNotificationScript_Sean.py", line 22 try requests.get('https://tradeogre.com/api/v1/account/balances', timeout=30, auth=('x', 'x')) as respo...
by seanspotatobusiness
Fri Sep 07, 2018 2:42 am
Forum: Beginners
Topic: How to automatically mute/unmute Pi between certain hours?
Replies: 17
Views: 1723

Re: How to automatically mute/unmute Pi between certain hours?

Thanks for theses suggestions. My previous attempts to make cron run things at start-up failed but maybe/hopefully this will be different. I need the notifications to continue throughout the night so I just want to mute the system volume. Am I right in thinking that cron would be more energy-efficie...
by seanspotatobusiness
Thu Sep 06, 2018 6:00 pm
Forum: Beginners
Topic: How to automatically mute/unmute Pi between certain hours?
Replies: 17
Views: 1723

How to automatically mute/unmute Pi between certain hours?

I'm using my Raspberry Pi 3 B+ to make notification sounds but I would like those sounds to be muted during the night. How can I make my Pi mute itself automatically between certain hours and then unmute automatically? I'm using the audio jack (not HDMI) to drive my speakers.
by seanspotatobusiness
Thu Sep 06, 2018 4:01 pm
Forum: Beginners
Topic: Script monitoring API - recovery after failure to respond to get request
Replies: 6
Views: 560

Script monitoring API - recovery after failure to respond to get request

I have a python script which checks the json output from a website's API every five minutes and notifies me by e-mail if there's change since the last check. Occasionally, I think the website screws up and doesn't return the expected output and then my script just stops running. Is there some way I ...
by seanspotatobusiness
Sun Sep 02, 2018 10:10 am
Forum: Troubleshooting
Topic: Pi doesn't boot when pins 5 and 6 are momentarily shorted
Replies: 16
Views: 1537

Re: Pi doesn't boot when pins 5 and 6 are momentarily shorted

I'm sure I have the right pins. It's pins 5 and 6 on this image:

Image

Go to advanced search