I am working on a small project in which a webpage is hosted on raspberry pi, there are some buttons with pre-defined values (single character). Whenever a user presses a button the data is sent to the pi.
I need to send that data/character to arduino which is connected to the pi via bluetooth.
Till now i have been able to send data to the arduino from terminal by running a python program which takes raw input and forwards it via sock.send()
import bluetooth
bd_addr = "MAC of Bluetooth"
port = 1
sock = bluetooth.BluetoothSocket (bluetooth.RFCOMM)
sock.connect((bd_addr,port))while 1:
tosend = raw_input()
if tosend != 'q':
sock.send(tosend)
else:
breaksock.close()
What i need help with is how to read the pressed button's character in a python program form html page and forward it via bluetooth.
I am using Python 2
the webpage is hosted using Lighttpd