pythonphparduinorfidnodemcu

Is there anyway we could use the data from rfid to fetch something from another website?


I made this project for my final project which is reading data from RFID and sending this ID to web PHP using Nodemcu Ardino.I actually want to assign some data to this unique ID and once this ID is scanned, use that particular information to search in another website and display that in web php !

for example: Rfid is attached to an vehicle and vehicle number is merged with rfid unique id ! once this rfid is scanned use that vehicle number and search in vehicle database and bring results to the php website !


Solution

  • You need to have some kind of storage on your backend side, which will map RFID IDs to some website.

    Then you could redirrect user to that website with HTTP codes 301 or 302.

    Here is a pseudocede example for client and server:

    # Client
    rfid_id = get_rfid_id()
    make_request_to_server(rfid_id)
    
    # Server
    storage = {
        '12345': 'http://google.com',
        '32548': 'http://ebay.com',
    }
    
    def on_new_request(rfid_id):
        if rfid_id not in storage:
            response_with_error('Unknown RFID ID')
    
        else:
            redirrect_to_url(storage[rfid_id])