Sunday, 26 May 2019

RC car improvements up to June 2019 - and a future possibility?

Car number 2 works with the software on SD card #3, but the problem is that it takes off too fast and needs a lot more room than I have to fully test it. It also doesn't respond very quickly to the tablet.

I'll give it a go with SD card #7, which has the AP built in and see if that is any better.

- 2019-06-13 Car number 2 with R-Pi3W and Card#7 out on the road, it works aside from the fact that left and right are wrong way around, just not very fast to respond. Is it worth doing a video showing it?
- How can I improve response times?


----------------------------

Because of the things that I have found out about pwm for driving the RC airplane servo's I might try and make the forward/back work using pwm with every press of the 'forward' button adding 5% to the pwm pulsewidth.

At the moment struggling to get basic pwm operation working in the program instead of go/stop.

---------------------------
9/9/2019
I did get this working.  One of the things about PWM is that driving Remote Control Servos
uses PWM of about 1.5% to 2.5% ( these are just approx figures from my mind, check elsewhere for actual limits) To drive the car motors I noticed that it didn't do anything at 5% PWM, so I made it increase in steps of 15% and this worked fine. Another challenge was getting the feedback to display in the HTML the figure of the PWM value.

Here is the python code for the car: [some comments removed]

from flask import Flask, render_template

# This gives us control of the Raspberry Pi's pins.
import RPi.GPIO as GPIO
import time

# Tell it which pin number we'll  be using to refer to the GPIO pins.
# We will use the physical pin ordering. Set initial state of pins
GPIO.setmode(GPIO.BOARD)

MotorFwd = 12
MotorBack = 16
MotorLeft = 19
MotorRight = 23
GPIO.setup(MotorFwd, GPIO.OUT)
GPIO.setup(MotorBack, GPIO.OUT)
GPIO.setup(MotorLeft, GPIO.OUT)
GPIO.setup(MotorRight, GPIO.OUT)

# PWM pin
u_d_pin_no = 18
GPIO.setup(u_d_pin_no, GPIO.OUT)


frequency_hertz = 50
pwm = GPIO.PWM(u_d_pin_no, frequency_hertz)

PWM_Stop = 0
PWM_value = 0
PWM_increment = 3
# becomes 15 after calculations

# total number of milliseconds in a a cycle.  Given this, we will then
# know both how long we want to pulse in this cycle and how long tghe
# cycle itself is.  That is all we need to calculate a duty cycle as
# a percentage.
ms_per_cycle = 1000 / frequency_hertz

# now lets get into Flask

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/motor-stop/')
def on():
    # motor.stop()
    PWM_value = 0
    duty_cycle_percentage = PWM_value
#    print("Duty Cycle[S]: " + str(duty_cycle_percentage))
    pwm.start(duty_cycle_percentage)
    return render_template('index.html')


@app.route('/up_15/')
def up_15():
    global PWM_value
    PWM_value = PWM_value + PWM_increment
    duty_cycle_percentage = PWM_value * 100 / ms_per_cycle
#    print("Duty Cycle[F]: " + str(duty_cycle_percentage))
    pwm.start(duty_cycle_percentage)
#    time.sleep(.5)
#    pwm.ChangeDutyCycle(0)
    return render_template('index.html', PWM_PC = duty_cycle_percentage)

@app.route('/down_15/')
def down_15():
    global PWM_value
    if (PWM_value > 0) :
        PWM_value = PWM_value - PWM_increment
        duty_cycle_percentage = PWM_value * 100 / ms_per_cycle
#        print("Duty Cycle[F]: " + str(duty_cycle_percentage))
        pwm.start(duty_cycle_percentage)
#        time.sleep(.5)
#        pwm.ChangeDutyCycle(0)
#    endif
    return render_template('index.html')

@app.route('/motor-left/')
def motorleft():
    GPIO.output(MotorLeft,GPIO.HIGH)
    GPIO.output(MotorRight, GPIO.LOW)
    time.sleep(1)
    GPIO.output(MotorLeft, GPIO.LOW)
    return render_template('index.html')

@app.route('/motor-right/')
def motorright():
    GPIO.output(MotorLeft, GPIO.LOW)
    GPIO.output(MotorRight, GPIO.HIGH)
    time.sleep(1)
    GPIO.output(MotorRight, GPIO.LOW)
    return render_template('index.html')


if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0')
# We have shut all our stuff down but we should do a complete
# close on all GPIO stuff.  There's only one copy of real hardware.
# We need to be polite and put it back the way we found it.
    pwm.stop()
    GPIO.cleanup()

--------------------------

Having done all this I decided to do an R/C boat as it would combine the motor drive and the servo drive. I have given up on this idea because 1] I don't have a boat  2] the little motor that I was going to use didn't work with PWM and 3] I don't have a propellor.


Friday, 17 May 2019

Four(!) RC cars now

May-2019
I seem to have been collecting cars to experiment on. This is what I have now.

Car #1  The one in the video, It was using a program called WebIOpi that became obsolete after an update to Raspbian. Also the original driver board broke after it was touched wrongly and has now been replaced by a Deek-Robot board. It still works.


and the deek-robot driver board. 
I only paid about a pound for this, but it works fine. 

Car # 2
This has taken a bit of work to get going because I have been trying to make a harness that can be moved between cars. What drove this is that Cars 1,2 &3 all have a 16 pin dual in-line receiver chip on them that have the same pinouts for forward and back, left and right.  On car 2 I replaced the IC with a DIL socket. The software that this is using is built on Flask from an article in Linux Format. 





Car #3 I have not touched this one yet, but as can be seen, it has the 16 pin DIL chip there for when I do get around to it.


This one was a 40MHz radio. It's the one that gave me the idea to make a common interface connection from the Raspberry Pi. 

Car #4 This one has a 16 pin IC surface mount and a bit smaller, but I'll bet that the pinouts are the same.  I'll have to modify the connections from my 16 pin DIL Header to connect to it. This one says it is 2.4GHz and it is a Maisto brand. Because of my history with Wifi with Telxon and the university, I wanted to try and drive it directly but a previous blog describes why this idea was a non-starter. 



That's it to date. Next step is to post a video of car #2 in operation.

25 June 2019:

In Car 2 the IC that has been replaced by a socket so that the harness from the R-Pi can plug straight in  has the following pinouts. This enabled me to build the harness. Note that the poor creation of this jpg has the 'right' label too high and it should be on pin 6.


Now the pinouts for the IC from Car 3 are as follows:

Which is the same.  For anybody who wants to check this, car 3 is a 40MHz unit using SM6135W IC and car 2 was a 27MHz and I'll have to look back in these blogs to find the IC part number.

The reason for belabouring this point is that with the R-Pi3w and the software in card #7, car 2 behaves well, but car 3 is all topsy turvy in that the L/R buttons make it go Forward/Backward, and the F/B buttons turn the car.  I don't understand it.




Thursday, 25 April 2019

2.4GHz RC cars and WiFi, A history and Investigation

This all came about because of my little hobby of reworking RC cars to be controlled by Raspberry Pi computers.

An early aside: In my last iteration I discovered that not all Wifi dongles are capable of being configured as Wifi Access points.   Here is how to discover that:
  https://wiki.archlinux.org/index.php/software_access_point

OK, I recently picked up a car that is labelled 2.4GHz and I wanted to know if I could connect to it with my Android tablet as I do with my other experiments. Neither Fing or Wifi analyzer programs would 'see'  the car. I begasn to wonder if perhaps it was using a different  2.4GHz physical layer, not DSSS (Direct Sequence) as I was used to in the old days of Telxon. The manufacturers of these cars do not give out any information about it, I can't even find a configuration manual.

This got me wondering what the current way of using wifi is, so I found this: https://en.wikipedia.org/wiki/IEEE_802.11
It does not mention in detail where these variations are used.

I started looking at the history of Wifi to see if there was anything there and found that the recorded history does not fit with my memories. https://en.wikipedia.org/wiki/Symbol_Technologies is  the view from a Symbol  Technologies viewpoint and this leaves out such a lot: http://www.fundinguniverse.com/company-histories/telxon-corporation-history/

Telxon acquired Telesystems Corporation. Their first offering was in the 900MHz band, but they soon moved up to the 2.4GHz band, though the radio was quite large to fit into the form factor of a Telxon PTC. I think this radio was called the 022 version.  They wanted a smaller radio and soon there was the 025 radio which was about 1.5 inches square and fit very nicely into a Telxon PTC.
What isn't mentioned is that Telxon sold the wireless division now called Aironet, to Cisco. This is mentioned here: https://en.wikipedia.org/wiki/Aironet_Wireless_Communications

Things have moved on since the great DSSS/FHSS fights with Symbol and now it seems that the common mode is OFDM   Orthogonal Frequency Division Multiplexing.

My investigation found this site that discusses the fact that different manufacturers use different forms of Wireless, some DSSS and some FHSS and some mixed, and that they are not compatible with each other, so the receiver must match the transmitter.
http://rcmodelreviews.com/spreadspectrum01.shtml  You need to get to page 5 at least.

Enough.




Thursday, 5 July 2018

Raleigh Grand Prix - Broken Fork.

On the 19th of June I got home from a ride and discovered that the fork on my Raleigh Grand Prix  (1974) had broken. It was only held in place by the wheel and mudguard.


It is a large 25 1/2  inch frame so the steering post is quite long. (25.8.cm).
I posted about it on the Facebook page for vintage Raleigh bikes and had an offer of a large fork from 'Clint' who is in Wisconsin.  Clint was going to investigate prices for shipping it. Michael says he has a spare from his Raleigh Record, but I think that it will be a bit smaller. No luck on e-bay.

It was also suggested that I could get Bob Jackson cycles to build me a new fork, but from his website I see that the cost is £150. Ouch.

Then a friend suggested that I look up Tony Greening, and ex-cycle racer and now frame builder. He only lives about half-a-mile away. He straightened the frame on the previous incarnation of this bicycle many years ago.  My LBS had suggested that he could weld it up, but might advise against it.  I didn't bother asking about that option.

Luckily I have a spare fork in my garage and the blades are the same length as the broken one, though the steering tube is shorter by about a centimetre. Tony suggested that he could remove the steering tube from in the crown with his lathe and buy a length of steel pipe from Ceeway a purveyor of bicycle tubing and parts for bike builders, which he would then create a new steering tube to fit.


After I got home I thought that I could saw the steering tube out of the crown of the broken forks, so that is what I did. After all, it is already the right length and threaded.

I have now given this to Tony and he will use the lathe to get rid of the excess metal and then fit it to the forks.

22 July 2018 Tony Phoned on Friday and had it ready for me.  Here is what the rebuilt fork looks like:


Notice the shape of the crown is not a 'Raleigh' shape. I have now resprayed the black part of the forks and rebuilt the bike, and everything is super.

I am on the road again, though I do need some new bar tape on the handlebars.

Finish.


Monday, 30 April 2018

RC-Car using Flask

WebIOPi is dead. It doesn't work with the latest raspbian.

[2018-10-15]
I have been trying other IOT programs without success.
In Linux Format October 2017 LXF229 there was an article about using Flask with an example.
sudo apt-get install python3-flask.
mkdir rc-far
cd rc-car
mkdir templates
save app.py in the rc-car directory
save index.html in the templates directory

[Need to install filezilla and transfer files to the Pi. Need to debug.] - leave for now. Copied and pasted contents of files using nano.

to test: browse from another device to 192.168.1.8:5000

[2018-10-16] created script with two lines as below and it worked.
Problems. Cannot stop forward/backward.
2. formatting of HTML.

[2020-8-26] Latest version of Raspian -Buster does not contain gpiozero

sudo apt install python3-gpiozero  needs to be done.


[2018-4-30]
It didn't work because the author Les Pounder forgot to add one or two steps. He was very quick to reply to me and we got it sorted.  The lines that I needed were:
export FLASK_APP=/home/pi/rc-car/app.py
flask run –host=192.168.1.8

I have now put these into a shell script file that I run to start things happening.

My file structure is
/home/pi/rc-car/template/jquery

It made use of GpioZero libraries that are different to those I was using before.  The main problem was that his example only seemed to use one motor, and I have two motors.  I did get it working to drive the main wheels.

A search found an example using flask that did have two motors, but this is one on each wheel, whereas my configuration is one to drive forwards and backwards, and one to turn the front wheels.
This is from a github example by Kevin Olson https://github.com/olsonk/web-robot
I put this on the Pi and it failed. I have sorted out one of the problems. In the app.py program the debugging print statements are in the wrong format. They have now changed to a function call and need the parameters in ().  Sorted, But it still fails.
I have found an email for kevin Olson and asked him. We shall see.
The Html file calls a javascript that is in a certain place. I don't have it. I tried to download  jquery and apt-get said I had the latest version.  I have now found a version on-line at https://code.jquery.com/jquery-3.3.1.js
 and created a folder 'jquery' and put this file in there, edited the html, and am ready to test.

Aside: For what it's worth, I have replaced the motor drivers by the Deek-Robot  board using the L293D chip. http://www.deek-robot.com/productshow.asp?id=17&small=4



I had changed the text in the index .html file from {{ Title}} to {{ RC-6 Olson model }} . It didn't like that. I think Title within {{...}} is passed over from the app.py?

Also it failed because it didn't like the file name index.html. I changed it to main.html and it worked. The browser sees it. Unfortunately the LEDs do not work. I always have this problem with identifying them, and I wonder if GPioZero Libraries use different numbering than I am used to.

Tomorrow?
2018-05-02 Not touched code. I bolted the Raspberry Pi zero down to the car chassis. It required making two flanges from an old plastic box and drilling the holes in it to attach it via the Meccano bolts and some very fine bolts that I found in my junk box. The RC car was a Meccano toy originally. I also cut down a piece of dowel to act as a mast for the Wireless dongle as the R-Pi zero has a 4 inch converter cable from micro-USB to USB.

GPIO Pins                   Wire Colour             Deek-Robot
6                                    Black                         GND
12                                  Orange                       In1
16                                  green                          In2
17                                  Red                            In4
21                                  Yellow                       In3

This seems to work all backwards using the WebIOPi program Left = right, FWD = Backwd.



2018-05-08
Catching up. I got it working  using Les Pounders programs. New problem is that forward backward only stay on for a short period.  I got rid of the Internet stuff by using the jscript stuff that i installed following the Olson instructions.

Here are the motor controls.   the sleep lines are commented out.
led = LED(25)
motor = Motor(forward=18, backward=23)
turn  = Motor(forward=10, backward=11) 


In LP's stuff the html is tidier, but doesn't put nice boxes. This is all in one line across the page with wrapping.

   Click on the buttons to trigger the action
                                                               

   

                                                                                       
    Motor Forward    
    Toggle LED       
    Motor Backward
    Motor Left   
    Motor Right
   


Here is the Olson code: 

                                  
               

               


                       
                       
               

               


                       
               

                


which does have separate lines for the Left/right 'buttons' 

Need to think about how I do it for the first one. 
Note. This writeup doesn't show the code, it shows the result. How do I fix that? 

--> No. LP stuff does have boxes, Forward/LED/Backward on the first line, and Left/right on the next line. It does use an external bit of code.  Problem is, I can only turn off forward by pressing Backward. LED Toggle works, and because I have forward/backward selected, I can't do Left/Right. 
Hmm.

2019-04-26

Update, I now have another car, labelled '2' It has the Raspberry Pi with SD card #3 in it which is the Flask code, but still requires an access point. Card #4 and #7 have the access point in the R-Pi so are not tethered to an Access point.

Anyway, yesterday I tried this car and noticed the ground wire between the R-Pi and the driver board started smoking and melting. Today it doesn't work, now that the wire has been rerouted. The batteries are good on both parts.  The R-Pi has been tested on my test rig and is OK.  The main difference since I 'built' this car some months ago are that the the wires now go from the R-Pi to the board through two 16 pin Dil Headers, one with the wires soldered into it and one on the board where the IC was.

OK, I tested without the driver board powered and just cheking the outputs of the R-Pi on to the board, and they were all coming out as -4.56V. Whoo!. What I discovered is that the ground wire to teh R-Pi was on pin4 (+5V), not pin 6 as it should be.  Fired it all up again and it sort of works, except everything is backwards. Forward on the web page makes it go backward, and Left turns Right!. Easy to fix.

Lets make the following changes:
GPIO pin 12 = brown  --> Red
GPIO pin 16 = red   -->Brown

GPIO Pin 23 = White --> Black
GPIO Pin 19 = Black --> White

One pin on the IC on the driver board does not make a connection so needs resoldering.





Friday, 30 March 2018

RC-CAr with Cayenne IOT Program.

2018-03-30
Starting from Raspian Jessie with fixed IP address.

In my folders this is Robot-6-Cayenne

https://mydevices.com/cayenne/landing/create-raspberry-pi-projects-with-cayenne/

First problem: It needs an app on a tablet. Have that.

It didn't work at first. I went in and deleted the /etc/webiopi/config file from the initial webIOPi configuration and then it connected.

Cayenne is NOT going to work  with my setup as is because 3 GPIO  pins are labelled as SPI pins and cannot be changed to I/O pins so I cannot control my left/right turning.   These are GPIO 9,10 and 11.

I am still not certain that I could have had it working without Internet access.

I need to find out how to delete Cayenne so that I can use the R-Pi for another technique without having to flash it all again and start from scratch.










Thursday, 29 March 2018

Webiopi upgrade from Wheezy to Jessie

DECISION: Forget WebIOPi on Jessie. Let's do the next two things:
1. Cayenne.
2. AD-Hoc Networking

----------- ------------ ---------


Webiopi was working on a card with Raspbian Wheezy, then I updated  and upgraded and I noticed that some files were labelled from Jessie.

After rebooting I couldn't get Webiopi to load. I could ssh into teh R-pi as normal, so I started the WebioPi service but I stiull could not load the web page. What follows is the log for WebIOPi. I'll look at it later to see if I can understand what to do.

2018-01-14 14:17:27 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:27 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:27 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:28 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:28 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:28 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:37 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:37 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:37 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:37 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:37 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:37 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:28 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:28 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:28 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:29 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:29 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:29 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-03-29 15:14:21 - WebIOPi - INFO - Stopping...
2018-03-29 15:14:22 - WebIOPi - INFO - CoAP Server stopped
2018-03-29 15:14:22 - WebIOPi - INFO - HTTP Server stopped
2018-03-29 15:14:52 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-03-29 15:14:52 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-03-29 15:14:52 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-03-29 15:14:52 - WebIOPi - ERROR - name 'GPIO' is not defined
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 75, in
    main(sys.argv)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 69, in main
    server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/server/__init__.py", line 52, in __init__
    self.gpio.addSetups(config.items("GPIO"))
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 62, in addSetups
    self.addGPIOSetup(gpio, params)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 55, in addGPIOSetup
    self.addGPIO(self.gpio_setup, gpio, params)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 45, in addGPIO
    func = GPIO.OUT
NameError: name 'GPIO' is not defined


There's one thing -->  GPIO is not defined.

things to try:
https://raspberrypi.stackexchange.com/questions/37327/global-name-gpio-is-not-defined-errors-on-webiopi

At the bottom of this is the suggestion that I start WebIOPi specifically via Python3. This gives the webIOpi menu and GPIO pin display, but doesnt operate them.  It didn't start my web page.


Commands:
 sudo /etc/init.d/webiopi stop
sudo python3 -m webiopi 8000
gives when stopped: 
pi@raspberrypi:/var/log $ sudo python3 -m webiopi 8000

2018-03-30 10:41:36 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4

2018-03-30 10:41:36 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO

2018-03-30 10:41:36 - WebIOPi - WARNING - Access unprotected

2018-03-30 10:41:36 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/

2018-03-30 10:41:36 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/

2018-03-30 10:41:36 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)

----------------------------------------

Exception happened during processing of request from ('::ffff:192.168.1.11', 46518, 0, 0)

Traceback (most recent call last):

  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/http
.py", line 238, in processRequest

    result = self.server.handler.do_GET(relativePath, compact)

  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/rest
.py", line 147, in do_GET

    return (200, self.getJSON(compact), M_JSON)

  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/rest
.py", line 245, in getJSON

    gpios[gpio][f] = GPIO.getFunctionString(gpio)

NameError: name 'GPIO' is not defined
And lots more repeats of this. 
???? 
Possibly this, but doesn't mention Jessie
http://webiopi.trouch.com/issues/140/

This first I think:
https://groups.google.com/forum/#!topic/webiopi/BGc-mcD3UEw
-- It won't work. My version number is the one already in the file.