Bluetooth dongle with cgi - python - Raspberry Pi Forums


hello guys,

i'm new forum world of raspberry pi.

trying following: wrote html site 2 radiobuttons , button, i'm running on apache server. when click button opens cgi skript wrote python. works when want print out browser value of radiobutton chosen. want start serial communication on bluetooth , talk arduino (i come arduino world). purpose wrote following script:

code: select all

#!/usr/bin/env python  import cgi import cgitb import serial time import sleep  cgitb.enable()  bluetoothserial = serial.serial("/dev/rfcomm1", baudrate=9600)  print "content-type: text/html\n\n"  form = cgi.fieldstorage()  if "subject" not in form: 	print "<h1>neither radio button selected.</h1>" else: 	text = form["subject"].value 	print "<h1>radio button chosen:</h1>" 	print cgi.escape(text)  bluetoothserial.write(text) 
supposed write browser button chosen , write value arduino. if change normal python script (no cgi) works perfect.
when click submit button in html file error back. basicly says there wrong line

code: select all

bluetoothserial = serial.serial("/dev/rfcomm1", baudrate=9600)
,
<class 'serial.serialutil.serialexception'>: not open port /dev/rfcomm1: [errno 13] permission denied: '/dev/rfcomm1'
args = ("could not open port /dev/rfcomm1: [errno 13] permission denied: '/dev/rfcomm1'",)
errno = none
filename = none
message = "could not open port /dev/rfcomm1: [errno 13] permission denied: '/dev/rfcomm1'"
strerror = none

part important, think. if wish can make screenshot , post whole error. guess need change permissions have not got idea. great if me this! :)

greatings



raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support