Go to advanced search

by Mark_M
Sat Jul 09, 2016 7:06 pm
Forum: Python
Topic: Mysql timestamp not working
Replies: 7
Views: 1730

Re: Mysql timestamp not working

Dougie,
I just tried current_timestamp in Python and it didn't work, but when I try running the command directly in MySQL it works.. Very odd
by Mark_M
Sat Jul 09, 2016 6:45 pm
Forum: Python
Topic: Mysql timestamp not working
Replies: 7
Views: 1730

Re: Mysql timestamp not working

Thanks Dougie!
I'll give that a try.
by Mark_M
Sat Jul 09, 2016 6:43 pm
Forum: Python
Topic: Mysql timestamp not working
Replies: 7
Views: 1730

Re: Mysql timestamp not working

If I run the MySQL function now(), it will automatically update my date field that is defined.

Statement ran in MySQL

Code: Select all

 INSERT INTO event (first_name, date) VALUES ('John', NOW())
It would insert 2016-07-09 13:33:43 into my date field. Not sure why it's not working with Python.
by Mark_M
Sat Jul 09, 2016 4:55 pm
Forum: Python
Topic: Mysql timestamp not working
Replies: 7
Views: 1730

Mysql timestamp not working

Hi everyone, I'm having a problem with using the timestamp function NOW(). Is anyone else having an issue with the he timpstamp function using mysql.connector? date = 'NOW()' event = ('INSERT INTO mb_event ' '(res_id, first_name, last_name, num, date) ' 'VALUES (%s, %s, %s, %s, %s)') cursor.execute(...
by Mark_M
Sat Jul 09, 2016 4:45 pm
Forum: Python
Topic: RPi.GPIO Wiegand capture speed?
Replies: 68
Views: 29110

Re: RPi.GPIO Wiegand capture speed?

Thanks Tom,
Works like a charm!

I'm going to be reading from an MySQL database, so didn't update the if statement yet.
by Mark_M
Sat Jul 02, 2016 2:25 am
Forum: Python
Topic: RPi.GPIO Wiegand capture speed?
Replies: 68
Views: 29110

Re: RPi.GPIO Wiegand capture speed?

Using same card (9817354), my first read is 26 bits then all reads after that are 27 bits... Reads with out format 01001010111001101000010100 19634708 ----------- 001001010111001101000010100 19634708 ----------- 001001010111001101000010100 19634708 ----------- 001001010111001101000010100 19634708 --...
by Mark_M
Fri Jul 01, 2016 5:20 am
Forum: Python
Topic: RPi.GPIO Wiegand capture speed?
Replies: 68
Views: 29110

Re: RPi.GPIO Wiegand capture speed?

Thanks Karl, have something odd going on now. I'm able to get a first good read with correct number but after that it adds the bit back to it.. Here is my code.. #!/usr/bin/env python #green/data0 is pin 8 #white/data1 is pin 10 import time import RPi.GPIO as GPIO D0 = 8 D1 = 10 bits = '' t = 15 tim...
by Mark_M
Thu Jun 30, 2016 7:46 am
Forum: Python
Topic: RPi.GPIO Wiegand capture speed?
Replies: 68
Views: 29110

Re: RPi.GPIO Wiegand capture speed?

Thanks Joan and Karl! Dividing by 2 once converted to demical is doing the trick. But would I be better off doing it your way Karl? I'm new to Python but come from a php background. Also there's not much information out there on the reader I'm using. It says.. Buzzer control line: when it is activat...
by Mark_M
Thu Jun 30, 2016 6:32 am
Forum: Python
Topic: RPi.GPIO Wiegand capture speed?
Replies: 68
Views: 29110

Re: RPi.GPIO Wiegand capture speed?

Hi everyone! I'm trying to setup a rfid reader also. It's a 125khz ([urlhttp://www.szjat.com.cn/pro_HM6003.html][/url]). I have it set to gpio14 and gpio15. I have tried both kghunt's code and Joan's code. Both working fine but the only problem I'm having is that is giving the wrong number. Say if m...

Go to advanced search