Go to advanced search

by Spartan09
Thu Mar 23, 2017 11:15 am
Forum: Python
Topic: CSV file?
Replies: 14
Views: 3844

Re: CSV file?

it may be that you are not giving the Pi time to read the tag before you try processing the answer. Try putting a sleep(0.5) between the line reading the tag and the if statement, like this while True: RFID = port.readline() time.sleep(0.5) if len(RFID)>10: you will of course need to add "import ti...
by Spartan09
Thu Mar 23, 2017 11:11 am
Forum: Python
Topic: CSV file?
Replies: 14
Views: 3844

Re: CSV file?

Hello, writing to a file is quite fast, usually. Is the csv-file very large ? Did you insert the print(RFID) direct after the read ? And how does this printout look like ? Post current code please. Regards, Gerhard hello, So when I put the print(RFID) after the readline the program get stuck in an ...
by Spartan09
Wed Mar 22, 2017 10:46 pm
Forum: Python
Topic: CSV file?
Replies: 14
Views: 3844

Re: CSV file?

No it's something to do with a loop.
There is a delay in printing the tag data to the csv file.
Although it will read the tag, it will only save the tag info to the csv file once the next tag has been scanned.
ie. it is always delayed until the next tag is scanned to write to the csv file
by Spartan09
Wed Mar 22, 2017 10:06 pm
Forum: Python
Topic: CSV file?
Replies: 14
Views: 3844

Re: CSV file?

Thank you for showing my where I am going wrong. I got a lot of learning to do. The code you have produced creates the csv file and fills it with the tag info as described, however the tag needs to be scanned twice as it is not saved in the .csv file the first time. I am guessing this is something t...
by Spartan09
Wed Mar 22, 2017 9:09 pm
Forum: Python
Topic: CSV file?
Replies: 14
Views: 3844

Re: CSV file?

So I tried the following but it still did not work make a .CSV file called data In write mode past the value for RFID in the .CSV file import csv import serial port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=0.5) while True: RFID = port.readline() if len(RFID)>10: print (RFID) with open('d...
by Spartan09
Wed Mar 22, 2017 8:04 pm
Forum: Python
Topic: CSV file?
Replies: 14
Views: 3844

CSV file?

Anyone know hoe i can save the scanned values into a .CSV file? the following code reads the RFID tag but doesn't save it in a CSV file import os import threading import urllib2 import Serial port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=0.2) while True: RFID = port.readline() if len(RFI...
by Spartan09
Wed Mar 22, 2017 5:00 pm
Forum: Python
Topic: uploading uart data to thingspeak
Replies: 1
Views: 971

uploading uart data to thingspeak

So I am trying to post RFID data to thingspeak. The ID-20 RFID reader TX pin is connected to the Raspberry pi RX pin. I can read the tag in the Pi Terminal but now want to post the tag number to thing speak. How can I go about doing this? I have written the attached code to do this but it doesn't se...

Go to advanced search