Go to advanced search

by TW79
Wed Mar 18, 2015 5:00 pm
Forum: Python
Topic: PWM and Servos
Replies: 1
Views: 476

PWM and Servos

All, I have successfully started controlling a servo with PWM, however once my servo reaches its programmed location, the servo jitters in it's attempt to forcefully hold a location. I understand that the way to prevent this is to send a single, programmed pulse to the servo, thereby allowing the se...
by TW79
Fri Nov 28, 2014 6:07 pm
Forum: Troubleshooting
Topic: Web Server Intermittent
Replies: 7
Views: 1122

Re: Web Server Intermittent

I used ipfingerprints.com to determine port status. When the site was down, port 80 gave a report of "Filtered" which (according the the site) means "A port is marked as "filtered" when the packets are sent to that port, however packet filtering (e.g., firewall) prevents the packets from reaching th...
by TW79
Fri Nov 28, 2014 5:58 pm
Forum: Troubleshooting
Topic: Web Server Intermittent
Replies: 7
Views: 1122

Re: Web Server Intermittent

Noip2 is being run on the Pi. I had it updating every hour, but just changed it to 5 minutes. I found a forum thread that indicated if the Pi doesn't have any internet activity, then the port isn't being listened to. I also noticed that when I was on an external computer, the site didn't come up, bu...
by TW79
Fri Nov 28, 2014 5:31 pm
Forum: Troubleshooting
Topic: Web Server Intermittent
Replies: 7
Views: 1122

Web Server Intermittent

Howdy all, I have set up my Pi as a web server using Apache2 and PHP5. I have also set up noip2 and opened port 80 on my router to point to the PI's IP. The PI has been assigned a static IP. I'm having issues with the website that I am hosting (www.weitzeltree.net) being unreachable intermittently. ...
by TW79
Wed Sep 10, 2014 1:56 pm
Forum: Python
Topic: remove newline
Replies: 7
Views: 2099

Re: remove newline

Thank you! strip() did the trick. Completed code below: #scan for tags and write IDs to --'ID'rfid.txt-- gpsfile = str(piid) + ".csv" import serial space = (',') ser = serial.Serial('/dev/ttyUSB0', 57600, timeout=100) print ser.name tagloop=0 with open (gpsfile, 'a') as f: while tagloop<30: rfidline...
by TW79
Wed Sep 10, 2014 12:40 pm
Forum: Python
Topic: remove newline
Replies: 7
Views: 2099

Re: remove newline

Yes, it successfully writes 30 tags. The problem is that each tag is read with a "\n" at the end. This is the nature of the beast. I need to remove that "\n" so I can have a truly Comma-Separated Value. Example: I am currently getting an output of 123456789 ,123456789 ,123456789 ,123456789 , What I'...
by TW79
Tue Sep 09, 2014 9:31 pm
Forum: Python
Topic: remove newline
Replies: 7
Views: 2099

Re: remove newline

I gave another crack at it, but now it's not writing the lines (rfidline), but I it IS printing them to the screen. I'm rather confused. #scan for tags and write IDs to --'ID'rfid.txt-- gpsfile = str(piid) + ".csv" import serial space = (',') ser = serial.Serial('/dev/ttyUSB0', 57600, timeout=100) p...
by TW79
Tue Sep 09, 2014 9:12 pm
Forum: Python
Topic: remove newline
Replies: 7
Views: 2099

remove newline

All, I am trying to read for RFID tags via serial and create a CSV of them. I have been successful in reading the lines and writing to a file, but they include a linebreak. How can I remove the linebreaks? I have tried strip(), and rstrip() but am not having any luck. Thoughts? #scan for tags and wr...
by TW79
Wed Sep 03, 2014 6:18 pm
Forum: Python
Topic: RFID with Python
Replies: 0
Views: 393

RFID with Python

Team, I am working on an RFID project, and am having trouble reading ALL tags in this script. This is the portion of my script where it looks for tags and writes them to a file: import serial space = (',') ser = serial.Serial('/dev/ttyUSB0', 57600, timeout=100) print ser.name tagloop=0 with open (gp...
by TW79
Tue Aug 19, 2014 9:35 pm
Forum: Python
Topic: Remove line breaks
Replies: 1
Views: 521

Remove line breaks

All, My script for creating a file is including line break from a script I can't figure out how to edit. I am trying to create a CSV file, and while the commas appear in the correct places, I can't seem to rid the final result of the \n lines. Is there a way to remove the line breaks after the file ...
by TW79
Fri Aug 15, 2014 6:18 pm
Forum: Python
Topic: Use variable name in filename
Replies: 1
Views: 558

Re: Use variable name in filename

I found my solution:

I created a variable in the file called "piid" and set it to "1001". I then created another variable for "rfidfilename" and used str to join the variable and string to create 1001rfid.txt.

Example:

Code: Select all

piid = "1001"
filename = str(piid) + "rfid.txt"
print filename
by TW79
Fri Aug 15, 2014 4:13 pm
Forum: Python
Topic: Use variable name in filename
Replies: 1
Views: 558

Use variable name in filename

All, In my script, I call for readlines to look in a file that contains only 4 characters (1001 in this case). I would like to store that number as a variable then have the script create a new file with the filename as the variable and "gps.txt" at the end. ex: 1001gps.txt I know how to create a new...
by TW79
Thu Aug 14, 2014 5:47 pm
Forum: Python
Topic: Script works but not exiting
Replies: 2
Views: 739

Re: Script works but not exiting

Forgive me. I'm a little new to Python.

Please clarify what you mean by Threading Threads. Obviously, if I'm asking that, then I don't know how to kill them. I'd appreciate your input.
by TW79
Thu Aug 14, 2014 4:48 pm
Forum: Python
Topic: Script works but not exiting
Replies: 2
Views: 739

Script works but not exiting

Team, I have modified and edited a script found online for the GPS breakout. Basically, the script looks for lat/long from the GPS three times, then saves to a file. After the GPS work is done, it listens on the ttyUSB0 port for some RFID's and writes THOSE to a file. It works marvelously, however a...
by TW79
Fri Aug 08, 2014 6:51 pm
Forum: Beginners
Topic: 3 UART devices
Replies: 5
Views: 1074

3 UART devices

All, I'm working on a project that will use an RFID reader, FONA, and the Ultimate GPS breakout. All three require UART. I've seen posts where multiplexers are used, but I've never dealt with those and I'm not sure what I'm getting myself into. Is there a way to use these three devices without a mul...
by TW79
Thu Jul 17, 2014 6:21 pm
Forum: Python
Topic: ValueError: signal in main thread
Replies: 11
Views: 2604

Re: ValueError: signal in main thread

I have started working on a single script to run the entire program I'm working on. So far, I have only created instances for the White and Blue buttons. Please tell me why the script suddenly stops. I need it to wait for some button input. Am I going about this all wrong? Thank you #!/usr/bin/pytho...
by TW79
Thu Jul 17, 2014 3:53 pm
Forum: Python
Topic: ValueError: signal in main thread
Replies: 11
Views: 2604

Re: ValueError: signal in main thread

Perhaps I'm missing the obvious. I imported the scripts at the top of rxsystemready. When I run it, whitebutton immediately runs. I need to have it wait until the white button is pressed before it executes. #!/usr/bin/python import RPi.GPIO as GPIO ## Import GPIO library GPIO.setmode(GPIO.BCM) ## Us...
by TW79
Thu Jul 17, 2014 3:37 pm
Forum: Python
Topic: ValueError: signal in main thread
Replies: 11
Views: 2604

Re: ValueError: signal in main thread

I changed the command to execute the other scripts. use execfile('bluebutton.py') (better use full path) instead of import bluebutton etc. While the scripts still execute as planned, I am still getting the error of "Main Thread". Even if I made this all one big script (which I'd have to learn how to...
by TW79
Thu Jul 17, 2014 2:32 pm
Forum: Python
Topic: ValueError: signal in main thread
Replies: 11
Views: 2604

Re: ValueError: signal in main thread

Ah, I see where you're coming from. If I have "import whitebutton" indented, then whitebutton.py becomes entirely indented. Am I right in my thinking here? If so, how do I get rxsystemready to wait for EITHER white or blue to be pressed without making either one indented? I've been trying to work on...
by TW79
Thu Jul 17, 2014 2:16 pm
Forum: Python
Topic: ValueError: signal in main thread
Replies: 11
Views: 2604

Re: ValueError: signal in main thread

The line in question IS part of the main thread in greenbutton.py. It's not indented at all, or part of an indented portion of script.
by TW79
Thu Jul 17, 2014 1:40 pm
Forum: Python
Topic: ValueError: signal in main thread
Replies: 11
Views: 2604

ValueError: signal in main thread

Once again, Python has confused me. In this case, I have three scripts in question: rxsystemready.py, whitebutton.py and greenbutton.py. rxsystemready.py is to wait for the user to either select the white button, or blue button, and execute the appropriate script. From what I can tell, this script r...
by TW79
Wed Jul 16, 2014 2:15 pm
Forum: Python
Topic: Wait for edge not responding
Replies: 6
Views: 2031

Re: Wait for edge not responding

That did the trick. Thank you!
by TW79
Wed Jul 16, 2014 1:54 pm
Forum: Python
Topic: Wait for edge not responding
Replies: 6
Views: 2031

Re: Wait for edge not responding

Now I'm even more confused. I copied your code verbatim and pasted near the top of the script, before the scanning routine. The script runs and successfully stops scanning for cards when GPIO23 is down, however redbutton doesn't seem to be importing. I've tried putting the code snippet in different ...
by TW79
Tue Jul 15, 2014 8:22 pm
Forum: Python
Topic: Wait for edge not responding
Replies: 6
Views: 2031

Re: Wait for edge not responding

Well that does certainly spreads some light on the subject. I removed the erroneous "Continue" commands and made some progress. However, once the script detects a card, it stops scanning for cards and waits for GPIO 23. Once pressed, redbutton imports correctly, but I need the script to keep searchi...
by TW79
Tue Jul 15, 2014 6:42 pm
Forum: Python
Topic: Wait for edge not responding
Replies: 6
Views: 2031

Wait for edge not responding

All, If you've seen my previous posts, you know the task of creating an RFID reader is starting to baffle me. I have attached my code below. Basically, I need the reader to constantly scan for cards and write the UID's to another file. That works perfectly. However, I also need to script to stop sca...

Go to advanced search